<template>
  <div class="product-container">
    <!-- 顶部横幅 -->
    <div class="top-banner">
      <div class="banner-content">
        <h1>产品功能地图</h1>
        <div class="banner-subtitle">全面展示产品功能架构与模块分布</div>
      </div>
    </div>

    <!-- 主体内容 -->
    <div class="main-content">
      <!-- 角色分类导航 -->
      <div class="role-navigation">
        <div 
          v-for="(role, index) in roles" 
          :key="index" 
          class="role-tab"
          :class="{ active: activeRole === role.name }"
          @click="activeRole = role.name"
        >
          {{ role.label }}
        </div>
      </div>

      <!-- 功能模块展示 -->
      <div class="function-modules">
        <!-- 员工功能模块 -->
        <div v-show="activeRole === 'employee'" class="role-section">
          <div class="module-category">
            <h2 class="category-title">门户服务</h2>
            <div class="module-grid">
              <div class="module-item" v-for="(module, index) in employeeModules.portal" :key="index">
                <div class="module-icon">
                  <i class="el-icon-s-home"></i>
                </div>
                <div class="module-name">{{ module }}</div>
              </div>
            </div>
          </div>

          <div class="module-category">
            <h2 class="category-title">共享服务</h2>
            <div class="module-grid">
              <div class="module-item" v-for="(module, index) in employeeModules.shared" :key="index">
                <div class="module-icon">
                  <i class="el-icon-share"></i>
                </div>
                <div class="module-name">{{ module }}</div>
              </div>
            </div>
          </div>
        </div>

        <!-- HR功能模块 -->
        <div v-show="activeRole === 'hr'" class="role-section">
          <div class="module-category">
            <h2 class="category-title">人才评鉴中心</h2>
            <div class="module-grid">
              <div class="module-item" v-for="(module, index) in hrModules.assessment" :key="index">
                <div class="module-icon">
                  <i class="el-icon-s-custom"></i>
                </div>
                <div class="module-name">{{ module }}</div>
              </div>
            </div>
          </div>

          <div class="module-category">
            <h2 class="category-title">人才库平台</h2>
            <div class="module-grid">
              <div class="module-item" v-for="(module, index) in hrModules.talentPool" :key="index">
                <div class="module-icon">
                  <i class="el-icon-notebook-2"></i>
                </div>
                <div class="module-name">{{ module }}</div>
              </div>
            </div>
          </div>
        </div>

        <!-- 经理功能模块 -->
        <div v-show="activeRole === 'manager'" class="role-section">
          <div class="module-category">
            <h2 class="category-title">业务条线</h2>
            <div class="module-grid">
              <div class="module-item" v-for="(module, index) in managerModules.business" :key="index">
                <div class="module-icon">
                  <i class="el-icon-s-management"></i>
                </div>
                <div class="module-name">{{ module }}</div>
              </div>
            </div>
          </div>

          <div class="module-category">
            <h2 class="category-title">决策支持</h2>
            <div class="module-grid">
              <div class="module-item" v-for="(module, index) in managerModules.decision" :key="index">
                <div class="module-icon">
                  <i class="el-icon-data-analysis"></i>
                </div>
                <div class="module-name">{{ module }}</div>
              </div>
            </div>
          </div>
        </div>
      </div>

      <!-- 功能详情面板 -->
      <div class="function-details">
        <h2 class="details-title">功能详情</h2>
        <div class="details-content">
          <div class="detail-item" v-for="(detail, index) in functionDetails" :key="index">
            <div class="detail-name">{{ detail.name }}</div>
            <div class="detail-desc">{{ detail.description }}</div>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: 'Product',
  data() {
    return {
      activeRole: 'employee',
      roles: [
        { name: 'employee', label: '员工' },
        { name: 'hr', label: 'HR' },
        { name: 'manager', label: '经理' }
      ],
      employeeModules: {
        portal: [
          '个人信息管理',
          '薪资查询',
          '假期申请',
          '考勤记录',
          '培训学习',
          '福利申请'
        ],
        shared: [
          '文档共享',
          '知识库',
          '内部论坛',
          '企业云盘',
          '协作工具',
          '公告通知'
        ]
      },
      hrModules: {
        assessment: [
          '能力测评',
          '绩效评估',
          '360度反馈',
          '职业规划',
          '潜力评估',
          '发展建议'
        ],
        talentPool: [
          '简历管理',
          '人才搜索',
          '人才标签',
          '人才追踪',
          '人才推荐',
          '人才报表'
        ]
      },
      managerModules: {
        business: [
          '团队管理',
          '任务分配',
          '绩效目标',
          '预算管理',
          '项目跟踪',
          '资源调配'
        ],
        decision: [
          '数据分析',
          '报表生成',
          '趋势预测',
          '风险预警',
          '绩效分析',
          '决策建议'
        ]
      },
      functionDetails: [
        {
          name: '个人信息管理',
          description: '员工可查看和更新个人基本信息、联系方式、教育背景等'
        },
        {
          name: '薪资查询',
          description: '员工可查看月度薪资明细、历史薪资记录和个税计算'
        },
        {
          name: '能力测评',
          description: 'HR可对员工进行多维度能力评估，生成测评报告和发展建议'
        },
        {
          name: '团队管理',
          description: '经理可查看团队成员信息、分配任务和跟踪工作进度'
        }
      ]
    };
  }
};
</script>

<style lang="less" scoped>
.product-container {
  // height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: #f5f7fa;
  overflow: hidden;

  .top-banner {
    background-color: #11657f; /* 红色横幅 */
    color: #fff;
    padding: 15px 20px;
    text-align: center;
    
    .banner-content {
      h1 {
        font-size: 24px;
        margin-bottom: 5px;
      }
      
      .banner-subtitle {
        font-size: 14px;
        opacity: 0.9;
      }
    }
  }

  .main-content {
    flex: 1;
    display: flex;
    overflow: hidden;
    padding: 15px;

    .role-navigation {
      width: 120px;
      background-color: #fff;
      border-radius: 4px;
      box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
      margin-right: 15px;
      overflow-y: auto;
      
      .role-tab {
        padding: 15px;
        text-align: center;
        cursor: pointer;
        transition: all 0.3s;
        border-bottom: 1px solid #f0f0f0;
        
        &:last-child {
          border-bottom: none;
        }
        
        &:hover {
          background-color: #f5f7fa;
        }
        
        &.active {
          background-color: #11657f;
          color: #fff;
        }
      }
    }

    .function-modules {
      flex: 1;
      background-color: #fff;
      border-radius: 4px;
      box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
      padding: 15px;
      overflow-y: auto;
      margin-right: 15px;
      
      .role-section {
        .module-category {
          margin-bottom: 20px;
          
          .category-title {
            font-size: 18px;
            color: #333;
            margin-bottom: 15px;
            padding-left: 10px;
            border-left: 4px solid #11657f;
          }
          
          .module-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
            gap: 15px;
            
            .module-item {
              background-color: #f9f9f9;
              border-radius: 6px;
              padding: 15px;
              text-align: center;
              transition: all 0.3s;
              border: 1px solid #e6e6e6;
              
              &:hover {
                transform: translateY(-5px);
                box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
                border-color: #11657f;
              }
              
              .module-icon {
                font-size: 24px;
                color: #11657f;
                margin-bottom: 10px;
              }
              
              .module-name {
                font-size: 14px;
                color: #333;
              }
            }
          }
        }
      }
    }

    .function-details {
      width: 300px;
      background-color: #fff;
      border-radius: 4px;
      box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
      padding: 15px;
      overflow-y: auto;
      
      .details-title {
        font-size: 16px;
        color: #333;
        margin-bottom: 15px;
        padding-bottom: 10px;
        border-bottom: 1px solid #e6e6e6;
      }
      
      .details-content {
        .detail-item {
          margin-bottom: 15px;
          padding-bottom: 15px;
          border-bottom: 1px solid #f0f0f0;
          
          &:last-child {
            border-bottom: none;
            margin-bottom: 0;
            padding-bottom: 0;
          }
          
          .detail-name {
            font-size: 14px;
            font-weight: bold;
            color: #11657f;
            margin-bottom: 5px;
          }
          
          .detail-desc {
            font-size: 13px;
            color: #666;
            line-height: 1.5;
          }
        }
      }
    }
  }
}

// 响应式调整
@media (max-width: 1200px) {
  .product-container {
    .main-content {
      flex-direction: column;
      
      .role-navigation {
        width: 100%;
        margin-right: 0;
        margin-bottom: 15px;
        display: flex;
        
        .role-tab {
          flex: 1;
        }
      }
      
      .function-details {
        width: 100%;
        margin-top: 15px;
      }
    }
  }
}

@media (max-width: 768px) {
  .product-container {
    .main-content {
      .function-modules {
        .role-section {
          .module-category {
            .module-grid {
              grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
            }
          }
        }
      }
    }
  }
}
</style>